import http from './http'


export interface AIListResponse {
  code: number
  msg: string
  data: AIItem[]
}

export interface AIChangedResponse {
  code: number
  msg: string
  data: AIChanged
}
export interface AIItem {
  name: string
  enabled: boolean
}

export interface AIChanged {
  is_enabled: boolean
}

// 获取AI状态列表
export const getAIListAPI = async (): Promise<AIListResponse> => {
  return await http.get('/mail/plugins/status')
}

//修改AI状态
export const updateAIStatusAPI = async (params: {
  plugin_name: string
  is_enabled: boolean
}): Promise<AIChangedResponse> => {
  return await http.post(`/plugin/toggle`, params)
}
